﻿/** 惩罚者

  By setycyas @2023-03-02
*/

/* 全局设定
*/ {
#Warn
#MaxThreadsPerHotkey 1
SetWorkingDir(A_ScriptDir)
#Include "..\Class\FaceDetector.2.ahk"
#Include "..\Class\CommonMacro.2.ahk"
#Include "..\Class\CommonUI.2.ahk"
#Include "..\Class\MyFuns.2.ahk"
#Include "..\Class\MyEmu.2.ahk"
#Include "..\Class\OrderMap.2.ahk"
SendMode("Event")
;SendMode("Input")
}

/* 制作惩罚者的宏类
*/ class PunisherMacro extends CommonMacro {

  pressDuration := 30

  /* 新增的宏函数
  */

  /* 重载宏接口
  */
  _setMacro(){
    this.macroMap := OrderMap()
    this.macroMap["连发A"] := this._连发A.bind(this)
    this.macroMap["下上A"] := this._下上A.bind(this)
    this.macroMap["后前A"] := this._后前A.bind(this)
    this.macroArr := this.macroMap.getKeys()
  }
}

/* 运行当前脚本
*/ if (A_ScriptName == "惩罚者.2.ahk") {
  face := FaceDetector() ;方向检测对象
  macro := PunisherMacro(face, ["q","f"]) ;宏对象,有界面时第二个参数可以随便写但长度不要小于2
  ;宏方案预设,用于菜单
  preset := OrderMap(["默认", ["连发A", "下上A", "下上A"]])
  ;新建界面对象并显示
  ui := CommonUI("惩罚者", macro, preset)
  ui.setup()
  ;更新组件内容
  ui._exeComboBox.Choose(MyEmu.NEBULA)
  ui._gameKeyEdit.Text := "e,f"
  ui._hotkeyEdit.Text := "d,s,c"
  ui._fpsEdit.Text := 15
  ui._testEdit.Text := "50,50,150"
  ui.readPresetMenu("默认")
}
